package StudyCode.summary.mycollection;

import java.util.Enumeration;
import java.util.Iterator;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class iteratorAsEnumeration {
	public static <T> Enumeration<T> iteratorAsEnumeration(final Iterator<T> it) {
		return new Enumeration<T>() {
			public boolean hasMoreElements() {
				return it.hasNext();
			}

			public T nextElement() {
				return it.next();
			}
		};
	}
}
